import axios from 'axios';
import { bind } from 'core-js/fn/function';
import { parseFloat } from 'core-js/fn/number';
export function request(config) {

    const instance = axios.create({
        baseURL: 'http://kf.laigl.com/',
        timeout: 10000,
        method: 'POST',
        data: {
            openid: 'oYaCz0nnBSIGoT4pX_ACjZ5o5_lc',
        }
    });
    return instance(config)
}
export function noopenidrequest(config) {

    const instance = axios.create({
        baseURL: 'http://kf.laigl.com/',
        timeout: 10000,
        method: 'POST',
        data: {
            user_id: 3
        }
    });
    return instance(config)
}
export function upload_images(config) {

    const instance = axios.create({
        timeout: 10000,
        method: 'POST',

    });
    return instance(config)
}

export function delete_image(config) {
    const intance = axios.create({
        baseURL: 'http://kf.laigl.com/',
        timeout: 10000,
        method: 'POST',
    })
    return intance(config)
}



/* 
var myPow = function(x, n) {
    if(n ==0){
        return 1;
    }else if(n>0){
        let result = 1
         for(let i = 0;i<n;i++){
             result = result*x
        }
    return result
    }else{
        let result = 1
        let num =0
       while( num >n){
        result*=x
        num--
       }
    return 1/result
    }
}
console.log(myPow(2.1,3))


var myPow = function(x, n){
   if(n==0){
       return 1
   }else if(n==1){
       return x
   }else{
       if(n>0){
            if(n%2==0){
                return myPow(x*x,n/2)
            }else{
                return myPow(x,n-1)*x
            }
       }else{
           n = -n
            if(n%2==0){
                return 1/myPow(x*x,n/2)
            }else{
                return 1/(myPow(x,n-1)*x)
            }
       }
   }
}

myPow(2,3)
*/